package dao

import (
	"zk2/globals"
	"zk2/internal/dto"
	"zk2/internal/models"
)

type PerSonDao struct {
}

func NewPersonDao() *PerSonDao {
	return &PerSonDao{}
}
func (p *PerSonDao) List(req dto.PersonReq) (persons []models.Person, err error) {
	db := globals.DB
	err = db.Debug().Where("user_id=?", req.UserId).Find(&persons).Error
	return persons, err
}
